/*
 * @Author: ૮₍ ˙О˙₎ა
 * @Date: 2023-07-16 10:20:35
 */
import { http } from '@/utils/request'
import type { reqTrademarkData, reqBaseTrademarkDetailRes } from '@/types/trademark'
/**
 * @description: 请求品牌列表
 * @return {*}
 * @param {string} page
 * @param {string} string
 */
export const reqTrademarkRes = (page: number, limit: number) => {
  return http<reqTrademarkData>(`/admin/product/baseTrademark/${page}/${limit}`, 'GET')
}

/**
 * @description: 新增品牌
 * @return {*}
 * @param {string} logoUrl
 * @param {string} tmName
 */
export const reqAddBaseTrademarkRes = (data: { logoUrl: string; tmName: string }) => {
  return http(`/admin/product/baseTrademark/save`, 'POST', data)
}

/**
 * @description: 删除品牌
 * @return {*}
 * @param {string} id
 */
export const reqRemoveRes = (id: number) => {
  return http(`/admin/product/baseTrademark/remove/${id}`, 'DELETE')
}

/**
 * @description: 品牌详情
 * @return {*}
 * @param {string} id
 */
export const reqBaseTrademarkDetail = (id: number) => {
  return http<reqBaseTrademarkDetailRes>(`/admin/product/baseTrademark/get/${id}`, 'GET')
}

/**
 * @description: 更新品牌
 * @return {*}
 * @param {string} id tmName logoUrl
 */
export const reqUpdateBaseTrademark = (data: { id?: string; tmName: string; logoUrl: string }) => {
  return http(`/admin/product/baseTrademark/update`, 'PUT', data)
}

/**
 * @description: 全部品牌
 * @return {*}
 */
export const reqAllBaseTrademark = () => {
  return http<reqBaseTrademarkDetailRes[]>(`/admin/product/baseTrademark/getTrademarkList`, 'GET')
}
